/*
 * @Description: 
 * @Autor: HuiSir<273250950@qq.com>
 * @Date: 2024-05-27 15:22:30
 * @LastEditTime: 2024-06-24 16:30:24
 */
import Request from "./request.js";

// 评论配置信息
export const getCommentConfig = (postId) => {
  return Request.get(`/theme_doubt/comment/config/${postId}`);
};

// 评论列表
export const getComments = ({ postId, pageNum }) => {
  return Request.get("/theme_doubt/comment/list", {
    params: {
      postId,
      pageNum,
    },
  });
};

// 发表评论
export const createComment = ({ id, authorId, authorEmail, authorName, authorUrl, content, parentId, postId }) => {
  return Request.post("/theme_doubt/comment/create", {
    comment_ID: id,
    user_ID: authorId,
    comment_author_email: authorEmail,
    comment_author: authorName,
    comment_author_url: authorUrl,
    comment_content:content,
    comment_parent: parentId,
    comment_post_ID: postId
  });
};


// 社交信息
export const getSocialMeta = (postId) => {
  return Request.get(`/theme_doubt/social/post/${postId}`);
}

// 更新点赞分享
export const updateSocialMeta = (postId, metaKey) => {
  return Request.post("/theme_doubt/social/update", {
    postId,
    metaKey,
  });
};